<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
  <head>
    <title>接口信息</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3"/>
    <meta name="description" content="this is my page"/>
    <meta name="content-type" content="text/html; charset=UTF-8"/>
	<script type="text/javascript" src="../js/jquery-2.1.4.js"></script>
	<script type="text/javascript" src="../js/tool.js"></script>	
	<script type="text/javascript" src="../js/interface/interfaceInfo.js"></script>
	<script type="text/javascript" src="../js/interface/interfaceFieldInfo.js"></script>	
	<script type="text/javascript" src="../js/Math.uuid.js"></script>
  </head>
  
  <body>
	<table>
		<tbody>
			<tr>
				<td>接口ID：</td><td><input type="text" name="interfaceId" th:value="${interfaceInfo.interfaceId}" /></td>
			</tr>
			<tr>
				<td>接口名称：</td><td><input type="text" name="interfaceName" th:value="${interfaceInfo.interfaceName}" /></td>
			</tr>
			<tr>
				<td>接口版本：</td><td><input type="text" name="interfaceVersion" th:value="${interfaceInfo.interfaceVersion}" /></td>
			</tr>
			<tr>
				<td>接口状态：</td>
				<td>
					<label><input type="radio" name="interfaceState" th:checked="${interfaceInfo.interfaceState}" value="1" />正常</label>
					<label><input type="radio" name="interfaceState" th:checked="${interfaceInfo.interfaceState == 0}" value="0" />关闭</label>
				</td>
			</tr>
			<tr>
				<td>接口说明：</td>
				<td>
					<textarea rows="10" cols="50" name="interfaceExplain" th:text="${interfaceInfo.interfaceExplain}" ></textarea>
				</td>
			</tr>
		</tbody>
	</table>
	<hr/>
	<div>
		<table>
			<tbody>
				<tr>
					<td>字段名:</td>
					<td><input type="text" id="interfaceFieldName" style="width: 400px"/></td>
					<td>字段类型:</td>
					<td>
						<select id="interfaceFieldType" style="width: 400px">
							<option value="FIELD_TYPE_INTEGER">integer</option>
							<option value="FIELD_TYPE_BOOLEAN">boolean</option>
							<option value="FIELD_TYPE_LONG">long</option>
							<option value="FIELD_TYPE_STRING">String</option>
							<option value="FIELD_TYPE_DATE">date</option>
							<option value="FIELD_TYPE_BIGDECIMAL">bigdecimal</option>
							<option value="FIELD_TYPE_OBJECT">对象</option>
							<option value="FIELD_TYPE_ARRAY">数组</option>
							<option value="FIELD_TYPE_REQ_SIGNATURE">请求签名</option>
							<option value="FIELD_TYPE_RES_SIGNATURE">返回签名</option>
							<option value="FIELD_TYPE_REQ_SERIAL_NO">请求流水号</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>字段位置:</td>
					<td>
						<select id="interfaceFieldPosition" style="width: 400px">
							<option value="FIELD_POSITION_REQ_URL_PATH">请求url路径</option>
							<option value="FIELD_POSITION_REQ_HTTP_PARAMS">http请求参数</option>
							<option value="FIELD_POSITION_REQ_PARAMS">请求参数</option>
							<option value="FIELD_POSITION_REQ_HTTP_HEAD">http请求头</option>
							<option value="FIELD_POSITION_REQ_HTTP_BODY">http请求体</option>
							<option value="FIELD_POSITION_RES_HTTP_HEAD">http返回头</option>
							<option value="FIELD_POSITION_RES_HTTP_BODY">http返回体</option>
							<option value="FIELD_POSITION_RES_PARAMS">返回参数</option>
						</select>
					</td>
					<td>是否必传:</td>
					<td><input type="checkbox" id="interfaceFieldIsNull" /></td>
				</tr>
				<tr>
					<td>字段说明:</td>
					<td><input type="text" style="width: 400px" id="interfaceFieldExplain" checked="checked"/></td>
					<td>上级字段:</td>
					<td>
						<select id="interfaceFieldInfo" style="width: 400px"></select>
					</td>
				</tr>
				<tr>
					<td colspan="4" style="text-align: center;">
						<button onclick="createInterfaceFieldInfo()">新增</button>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	<hr/>
	<table border="1" style="width: 100%">
		<thead>
			<tr>
				<td style="text-align: center;" colspan="6">参数</td>
				<td><button onclick="showFidld()">刷新</button></td>
			</tr>
			<tr>
				<td style="width: 180px">字段名</td>
				<td style="width: 100px">字段类型</td>
				<td style="width: 100px">字段位置</td>
				<td style="width: 90px">是否必传</td>
				<td>字段说明</td>
				<td style="width: 150px">上级字段</td>
				<td style="width: 150px">操作</td>
			</tr>
		</thead>
		<tbody id="field_item">
		</tbody>
	</table>
	<div id="templates" style="display: none;">
		<table >
			<tbody id="fieldTemplates">
				<tr>
					<td><input type="text" name="interfaceFieldName_templates" id="interfaceFieldName_templates" value=""/></td>
					<td>
						<select name="interfaceFieldType_templates" id="interfaceFieldType_templates">
							<option value="FIELD_TYPE_INTEGER">integer</option>
							<option value="FIELD_TYPE_BOOLEAN">boolean</option>
							<option value="FIELD_TYPE_LONG">long</option>
							<option value="FIELD_TYPE_STRING">String</option>
							<option value="FIELD_TYPE_DATE">date</option>
							<option value="FIELD_TYPE_BIGDECIMAL">bigdecimal</option>
							<option value="FIELD_TYPE_OBJECT">对象</option>
							<option value="FIELD_TYPE_ARRAY">数组</option>
							<option value="FIELD_TYPE_REQ_SIGNATURE">请求签名</option>
							<option value="FIELD_TYPE_RES_SIGNATURE">返回签名</option>
							<option value="FIELD_TYPE_REQ_SERIAL_NO">请求流水号</option>
						</select>
					</td>
					<td>
						<select name="interfaceFieldPosition_templates" id="interfaceFieldPosition_templates">
							<option value="FIELD_POSITION_REQ_URL_PATH">请求url路径</option>
							<option value="FIELD_POSITION_REQ_HTTP_PARAMS">http请求参数</option>
							<option value="FIELD_POSITION_REQ_PARAMS">请求参数</option>
							<option value="FIELD_POSITION_REQ_HTTP_HEAD">http请求头</option>
							<option value="FIELD_POSITION_REQ_HTTP_BODY">http请求体</option>
							<option value="FIELD_POSITION_RES_HTTP_HEAD">http返回头</option>
							<option value="FIELD_POSITION_RES_HTTP_BODY">http返回体</option>
							<option value="FIELD_POSITION_RES_PARAMS">返回参数</option>
						</select>
					</td>
					<td>
						<input type="checkbox" name="interfaceFieldIsNull_templates" id="interfaceFieldIsNull_templates" />
					</td>
					<td>
						<input type="text" style="width: 95%" name="interfaceFieldExplain_templates" id="interfaceFieldExplain_templates"/>
					</td>
					<td>
						<select name="interfaceFieldInfo_templates" id="interfaceFieldInfo_templates"></select>
					</td>
					<td>
						<button id="button_delete_templates">删除</button>
					</td>
				</tr>
			</tbody>
		</table>
		<table>
			<tbody id="tableTemplates">
				<tr id="tr_interfaceFieldInfos_Templates">
					<td></td>
					<td colspan="" id="td_interfaceFieldInfos_colspan_Templates">
						<table border="1" style="width: 100%">
							<thead>
								<tr>
									<td style="width: 180px">字段名</td>
									<td style="width: 100px">字段类型</td>
									<td style="width: 100px">字段位置</td>
									<td style="width: 90px">是否必传</td>
									<td>字段说明</td>
									<td style="width: 150px">上级字段</td>
									<td style="width: 150px">操作</td>
								</tr>
							</thead>
							<tbody id="tbody_interfaceFieldInfos_templates">
								
							</tbody>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
  </body>
</html>
